﻿using System;
using System.Windows.Input;

namespace CustomControlDatabaseInterface.Model
{
    public class TechControlFilter
    {
        public String Technology { get; set; }
        public String Control { get; set; }

        public static int FilterCount = 0;

        private int FilterId { get; set;  }

        public TechControlFilter( String technology, String control ) {
            FilterCount++;
            this.FilterId = FilterCount; 
            Technology = technology;
            Control = control;
            RemoveFilterCommand = new RelayCommand(param => this.OnRemoveFilter());

        }

        public ICommand RemoveFilterCommand { get; set; }

        public delegate void RemoveFilterHandler(TechControlFilter filter);

        public event RemoveFilterHandler RemoveFilter; 

        public void OnRemoveFilter() {
            RemoveFilterHandler handler = this.RemoveFilter; 
            if (RemoveFilter != null) {
                handler(this); 
            }
        }


    }
}
